<template>
  <div class="music-video">
    <nav-bar @clickBarItem="clickBarItem" :navBarItem="navBarData"></nav-bar>
    <router-view class="videoList"></router-view>
  </div>
</template>

<script>
import NavBar from "../../../components/NavBar/NavBar";

export default {
  name: "videoIndex",
  data() {
    return {
      navBarData: [
        {name: "视频", path: "/video/videolist"},
        {name: "MV", path: "/video/mvlist"},
      ],
    }
  },
  methods: {
    // 接收navbar传来的点击事件
    clickBarItem(path) {
      this.$router.push(path);
    },
  },
  created() {
      if (!this.$store.state.MusicStore.isLogin) {
        layer.msg('请先登录',{
        icon:7,
        time:1000
      })
        // this.$message.error("请先登录");
        this.$router.replace("/media/music");
      }
    },
  components:{
    NavBar,
  }
}
</script>

<style scoped lang="less">
.music-video {
  overflow-y: hidden;
  padding: 0 !important;
}
</style>
